package config

type Service struct {
	Name        string       `json:"name" yaml:"name"`
	Type        string       `json:"type" yaml:"type"`
	LoadBalance string       `json:"loadBalance" yaml:"loadBalance" default:"roundRobin"`
	TargetPath  []TargetPath `json:"targetPath" yaml:"targetPath"`
	Consul      ConsulConfig `json:"consul" yaml:"consul"`
	Nacos       NacosConfig  `json:"nacos" yaml:"nacos"`
	Enable      bool         `json:"enable" yaml:"enable" default:"true"`
}

type TargetPath struct {
	Path   string `json:"path" yaml:"path"`
	Weight int    `json:"weight" yaml:"weight" default:"1"`
}

type ConsulConfig struct {
	Address    string `json:"address" yaml:"address"`
	Scheme     string `json:"scheme" yaml:"scheme"`
	Token      string `json:"token" yaml:"token"`
	Datacenter string `json:"datacenter" yaml:"datacenter"`
}

type NacosConfig struct {
	Scheme      string   `json:"scheme" yaml:"scheme"`
	Address     string   `json:"address" yaml:"address"`
	Port        uint64   `json:"port" yaml:"port"`
	ContextPath string   `json:"contextPath" yaml:"contextPath"`
	NamespaceId string   `json:"namespaceId" yaml:"namespaceId"`
	Username    string   `json:"username" yaml:"username"`
	Password    string   `json:"password" yaml:"password"`
	GroupName   string   `json:"groupName" yaml:"groupName"`
	Clusters    []string `json:"clusters" yaml:"clusters"`
}
